/**
 * 修改分组名称界面
 */
var ClubGroupChangNameWindow = Window.extend({
    _ccsFileName: res.ClubGroupChangNameWindow_json,
    _data: null,
    _clubId: null,
    initWindow: function (clubId, data) {
        this._clubId = clubId;
        this._data = data;
    },

    _initClickListeners: function () {
        this._clickListeners = {
            'btn_ok': '_clickOk',
        }
    },

    _clickOk: function () {
        var str = this._nodeList['input'].getString();
        if (str == '' || str.length == 0) {
            showToast('请输入组名称');
            return;
        }
        if (str == '' || str.length > 5) {
            showToast('最多5个字');
            return;
        }
        if (this._data['type'] && this._data['type'] == ClubGroupBtn_AddGroup) {
            network.send(2103, {cmd: ClubMsgCode.AddClubGroup, club_id: this._clubId, name: str});
        } else {
            network.send(2103, {
                cmd: ClubMsgCode.AddmodifyClubGroup,
                club_id: this._clubId,
                name: str,
                pos: this._data.pos
            });
        }

        this.close();
    }

});